package com.gq.rising.util;

import org.springframework.util.StringUtils;

import java.util.Map;

/**
 * 校验工具类
 */
public class ValidUtils {

    /**
     * 校验输入参数，不抛异常则校验通过
     * @param inputBoxValue
     * @throws RuntimeException
     */
    public void checkInParam(Map<String,Object> inputBoxValue) throws RuntimeException{
        if(StringUtils.isEmpty(inputBoxValue.get("boxHost"))){
            throw new RuntimeException("主机Host不允许为空！");
        }
        if(StringUtils.isEmpty(inputBoxValue.get("port"))){
            throw new RuntimeException("端口号不允许为空！");
        }
        if(StringUtils.isEmpty(inputBoxValue.get("userName"))){
            throw new RuntimeException("用户名不允许为空！");
        }
        if(StringUtils.isEmpty(inputBoxValue.get("pwWord"))){
            throw new RuntimeException("密码不允许为空！");
        }
    }
}
